package com.tiantian.system.service.impl;

import com.tiantian.system.domain.entity.SysNotice;
import com.tiantian.system.mapper.SysNoticeMapper;
import com.tiantian.system.service.SysNoticeService;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tiantian
 */
@RequiredArgsConstructor
@Service("sysNoticeService")
public class SysNoticeServiceImpl implements SysNoticeService {

    private final SysNoticeMapper sysNoticeMapper;


    /**
     * 分页查询
     */
    @Override
    public List<SysNotice> selectList(SysNotice sysNotice) {
        return sysNoticeMapper.selectList(sysNotice);
    }

    /**
     * 新增数据
     */
    @Override
    @Async
    public void insert(SysNotice sysNotice) {
        sysNoticeMapper.insert(sysNotice);
    }


    /**
     * 通过主键删除数据
     */
    @Override
    public Boolean deleteById(Integer noticeId) {
        return sysNoticeMapper.deleteById(noticeId);
    }

}


